public class Numbers
{
   /**
      Combines two numbers with a given operator.
      @param op one of "+", "-", "*", "/", or "^" (for power)
      @param first the first argument
      @param second the second argument
      @return the result of evaluating the operator with the arguments
   */
   public static double evaluate(String op, double first, double second)
   {
      double sum = 0;
      System.out.print(op+first+second);
      if( op.equals("+"))
      {
         sum =  first + second;
      }
      if( op.equals("-"))
      {
         sum = first - second;
      }
      if( op.equals("*"))
      {
         sum = first * second;
      }
      if( op.equals("^"))
      {
         sum = Math.pow( first, second);
      }
      if( op.equals("/"))
      {
          sum = first / second;
      }
      return sum;
   }
}